﻿using System;
using System.Collections.Generic;
using System.Text;
using Tree.Lifecycle;

namespace Tree.Factory
{
    /// <summary>
    /// Object Factory.
    /// </summary>
    public interface IObjectFactory
    {
        /// <summary>
        /// Creates a object using the specified parameters.
        /// </summary>
        /// <typeparam name="T">Object type.</typeparam>
        /// <param name="parameters">Parameters to create the object. This must match the object constructor.</param>
        /// <returns>The created object.</returns>
        T Create<T>(params object[] parameters) where T : class;

        /// <summary>
        /// Creates a object using the specified parameters.
        /// </summary>
        /// <param name="type">Object type.</param>
        /// <param name="parameters">Parameters to create the object. This must match the object constructor.</param>
        /// <returns>The created object.</returns>
        object Create(Type type, params object[] parameters);
    }
}
